-
-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Elevation Configuration #56
base: primary
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## primary #56 +/- ##
=============================================
- Coverage 98.71% 98.13% -0.58%
- Complexity 610 612 +2
=============================================
Files 45 45
Lines 1708 1718 +10
=============================================
Hits 1686 1686
- Misses 22 32 +10
Continue to review full report at Codecov.
|
Yash, codecov.io is working again! |
I've added the |
5c6d77e
to
8a145b0
Compare
Could you please rebase? |
8a145b0
to
bdeab0c
Compare
Needs a rebase :) |
bdeab0c
to
bcf7bc6
Compare
Not ready yet :) |
src/Admins/SearchAdmin.php
Outdated
@@ -12,13 +16,34 @@ | |||
class SearchAdmin extends ModelAdmin | |||
{ | |||
private static $managed_models = [ | |||
SearchClass::class | |||
SearchClass::class, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove SearchClass for now?
SearchClass::class | ||
SearchClass::class, | ||
Elevation::class, | ||
ElevatedItem::class, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't ElevatedItem
be managed through Elevation
?
|
||
$gridField | ||
->getConfig() | ||
->addComponent(new GridFieldOrderableRows('Rank')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe also add inline editing if it's possible? Saves users from clicking "new" etc.
'Keywords' => Elevation::class, | ||
]; | ||
|
||
private static $summary_fields = ['Title', 'Rank', 'ObjectClass', 'SolrID', 'Include', 'Exclude']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make it a list 😄
Also, I think ObjectClass
should be replaced with a method, that returns the Singular name of the class. A bit more friendly :)
private static $table_name = 'ElevatedItem'; | ||
|
||
private static $db = [ | ||
'Rank' => 'Int', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you stick to my standard of aligning the =>
? Sorry, I'm really picky 😄
'Items' => ElevatedItem::class, | ||
]; | ||
|
||
private static $summary_fields = ['ID', 'Keyword']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above, it would be good to list them out instead of using as a string.
Also, I'd add Items.Count
, so people can see how many items are elevated by this keyword without having to look deeper.
@@ -810,7 +810,7 @@ | |||
<lst name="defaults"> | |||
<str name="echoParams">explicit</str> | |||
<int name="rows">10</int> | |||
<str name="df">_text</str> | |||
<str name="df">text</str> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rename is good, but I'm mildly afraid it might clash at some point with the Text
DBObject from SilverStripe, causing confusion in naming etc.. Do you have any thoughts about that?
Final comment, instead of using the It would most likely make the code a lot clearer, having an Solarium docs around it are here: Given that currently we use the |
'SolrID' => 'Varchar(255)', | ||
'Include' => 'Boolean(1)', | ||
'Exclude' => 'Boolean(0)', | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very thorough $db
settings. I like!
'ObjectClass' => 'Varchar(255)', | ||
'ObjectID' => 'Int', | ||
'SolrID' => 'Varchar(255)', | ||
'Include' => 'Boolean(1)', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For readability, I prefer using Boolean(true)
and Boolean(false)
over 1
and 0
83712cb
to
69471d3
Compare
01e90e5
to
8e3dacc
Compare
What is the current status? |
Apologies @Firesphere, got distracted by a lot of things and React. I suggest after 1.0 release 😊 |
Coolbeans. It's not a heavy requirement to match FTS anyway :) |
8e3dacc
to
b64b41d
Compare
b64b41d
to
6f9357b
Compare
You might need to update the tests a bit :) |
Woah! Did you get the React components working?! Really keen to see that in action! |
Still a work in progress but yeah, the |
56f61e2
to
aa44e02
Compare
f8fadb0
to
77a4b04
Compare
@@ -57,4 +64,23 @@ public function init() | |||
|
|||
Requirements::css('firesphere/solr-search:client/dist/main.css'); | |||
} | |||
|
|||
public function getEditForm($id = null, $fields = null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid variables with short names like $id. Configured minimum length is 3.
|
||
use SilverStripe\ORM\DataObject; | ||
|
||
class ElevatedItem extends DataObject |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The property $table_name is not named in camelCase.
|
||
use SilverStripe\ORM\DataObject; | ||
|
||
class ElevatedItem extends DataObject |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The property $belongs_many_many is not named in camelCase.
|
||
use SilverStripe\ORM\DataObject; | ||
|
||
class ElevatedItem extends DataObject |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The property $summary_fields is not named in camelCase.
|
||
class ElevatedItem extends DataObject | ||
{ | ||
private static $table_name = 'ElevatedItem'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid unused private fields such as '$table_name'.
Code Climate has analyzed commit 77a4b04 and detected 18 issues on this pull request. Here's the issue category breakdown:
The test coverage on the diff in this pull request is 0.0% (50% is the threshold). This pull request will bring the total coverage in the repository to 98.0% (-0.5% change). View more on Code Climate. |
No description provided.